import imageUpload from './imageUpload'
export default {
  install(Vue) {
    // 全局过滤器，处理图片问题
    Vue.directive('fixImg', {
      inserted(el, binding) {
        el.src = el.src || binding.value
        // console.log(el, binding)
        el.onerror = () => {
          el.src = binding.value
        }
      },
      update(el, binding) {
        el.src = el.src || binding.value
      }
    })
    Vue.component('imageUpload', imageUpload)
  }
}
